import React, { Component, Suspense } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import { connect } from 'dva';
// import { connect } from 'dva';

import { FormattedMessage } from 'umi-plugin-react/locale';
import { Row, Col, Card, Icon, Tooltip, Form } from 'antd';
import styles from "./index.less";
import ReactJson from 'react-json-view'


class Evaluate extends Component {
  constructor() {
    super();
    this.state = {
     todo:{"success":true,"message":"success"}

    };
  }

  componentDidMount() {

  }



  render() {

    return (
      <Card
        bordered={false}
      >
        <p>该接口用于标记机器人回答是否解决用户问题。例如在聊天界面上，机器人回答下方通常有两个按钮【已解决】和【未解决】，当用户单击这两个按钮时触发该接口。</p>
        <div className={styles.jksm}>1.1接口说明</div>
        <div className={styles.tablea}>
          <div className={styles.tableb}>调用说明</div>
          <div className={styles.tablec}>
            <div className={styles.tabled}>
              <div style={{ width: '210px', borderRight: '1px solid #e0e0e0', marginLeft: 10 }}>属性</div>
              <div style={{ width: 'calc(100% - 210px)', marginLeft: 10 }}>https://office.chatbot.cn:19009/service/evaluateRobotAnswer</div>
            </div>
            <div className={styles.tabled}>
              <div style={{ width: '210px', borderRight: '1px solid #e0e0e0', marginLeft: 10 }}>方法</div>
              <div style={{ width: 'calc(100% - 210px)', marginLeft: 10 }}><span className={styles.tabs}>GET</span></div>
            </div>
            <div className={styles.tablee}>
              <div style={{ width: '210px', borderRight: '1px solid #e0e0e0', marginLeft: 10 }}>参数说明</div>
              <div style={{ width: 'calc(100% - 210px)', marginLeft: 10 }}>
                <div style={{ height: 7 }}></div>
                <div><span className={styles.tabs}>channel</span><span>:访客的来源渠道;</span></div>
                <div style={{ height: 2 }}></div>
                <div><span className={styles.tabs}>robotId</span><span>:机器人唯一标识ROBOT_ID;</span></div>
                <div style={{ height: 2 }}></div>
                <div><span className={styles.tabs}>chatId</span><span>:当前聊天记录ID;</span></div>
                <div style={{ height: 2 }}></div>
                <div><span className={styles.tabs}>isResolved</span><span>:true/false，是否解决了用户问题;</span></div>
                <div style={{ height: 2 }}></div>
                <div><span className={styles.tabs}>callback</span><span>(可选):该参数主要用于js的跨域调用，通过callback传入回调的函数名;</span></div>
                <div style={{ height: 7 }}></div>
              </div>
            </div>
            <div className={styles.tablef}>
              <div style={{ width: '210px', borderRight: '1px solid #e0e0e0', marginLeft: 10 }}>响应</div>
              <div style={{ width: 'calc(100% - 210px)', marginLeft: 10 }}>
                <div style={{ height: 7 }}></div>
                <div><span>响应为</span><span className={styles.tabs}>json</span><span>格式。响应字段如下:</span></div>
                <div style={{ height: 2 }}></div>
                <div><span className={styles.tabs}>success</span><span>:true/false，表示操作是否成功;</span></div>
                <div style={{ height: 2 }}></div>
                <div><span className={styles.tabs}>message</span><span>:描述信息</span></div>
                <div style={{ height: 7 }}></div>
              </div>
            </div>
          </div>
        </div>
        <div style={{ height: 20 }}></div>
        <div style={{ border: '1px dashed #e0e0e0' }}></div>
        <div style={{ height: 20 }}></div>
        <div className={styles.jksm}>1.2接口示例</div>
        <div style={{ height: 20 }}></div>
        <p>请求:</p>
        <div style={{ height: 20 }}></div>
        <div className={styles.accesssl}><p>GET /service/evaluateRobotAnswer?channel=app&robotId=5b513ab0200b014800687107&chatId=xxx&isResolved=true HTTP/1.1Host: vip.chatbot.cn</p></div>
        <div style={{ height: 20 }}></div>
        <p>响应:</p>
        <div style={{ height: 20 }}></div>
        <div className={styles.accesssl}>
          <p>HTTP/1.1 200 OK</p>
          <p>Content-Type: application/json; charset=utf-8</p>
          <p>Date:Fri, 15 Jul 2016 03:15:54 GMT</p>
          <p>Content-Length: 36</p>
          <p><ReactJson src={this.state.todo}  theme='monokai' /></p>
        </div>
      </Card>
    );
  }
}


export default connect(({ user }) => ({ // 全局数据
  currentUser: user.currentUser,
}))(Form.create()(Evaluate));
